import { createRouter, createWebHashHistory } from "vue-router"
import { clientRoutes } from "@/router/client"
import { serverRoutes } from "@/router/server"

export const routes = import.meta.env.VITE_TYPE === "SERVER" ? serverRoutes : clientRoutes

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      name: "login",
      component: () => import("@/views/login/Index.vue")
    },
    {
      path: "/home",
      name: "home",
      redirect:"/overview",
      component: () => import("@/views/home/Index.vue"),
      children: routes
    }
  ]
})

export default router
